CC = gcc
LEX = flex
YACC = yacc

CFLAGS = -W
LDFLAGS =
LEXFLAGS =
YACCFLAGS = -d

SRC = $(wildcard *.c *.h)
OBJ = $(SRC:.c=.o)
OUT = draw
 
all : $(OUT) 

$(OUT) : y.tab.c lex.yy.c *.c *.h
	$(CC) $(CFLAGS) $^ -o $@
y.tab.c lex.yy.c : *.l *.y
	$(LEX) $(LEXFLAGS) $<
*.l : y.tab.h
y.tab.h : *.y
	$(YACC) $(YACCFLAGS) $<
clean :
	@rm -f y.* lex.*
delete : clean
	@rm -f $(OUT)
